package com.cool.util;

import com.cool.dto.response.CommonResponse;
import com.cool.dto.response.CommonResult;

/**
 * @author bian
 * @date 2021-03-28
 */
public class ResultUtil {
    public static <T extends CommonResponse> void setSuccessResponse(T response) {
        response.setResult(buildSuccessResult());
    }

    private static CommonResult buildSuccessResult() {
        // return new CommonResult().resultCodeSet(ServiceCodeEnum.SUCCESS.getCode()).resultDescSet(ServiceCodeEnum.SUCCESS.getDesc());
        return null;
    }

    public static <T extends CommonResponse> void setFailResponse(T response) {
        response.setResult(buildFailResult());
    }

    private static CommonResult buildFailResult() {
        // return new CommonResult().resultCodeSet(ServiceCodeEnum.FAIL.getCode()).resultDescSet(ServiceCodeEnum.FAIL.getDesc());
        return null;
    }
}
